<%@ page session="true" import="de.htwg_konstanz.ebus.framework.wholesaler.api.bo.*"%>
<%@ page session="true" import="de.htwg_konstanz.ebus.framework.wholesaler.api.boa.*"%>
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>eBusiness Framework Demo - Product List</title>
<link rel="stylesheet" type="text/css" href="style.css" />
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="pragma" content="no-cache">
</head>

<%@ include file="error.jsp" %>
<%@ include file="authentication.jsp" %>

<body>
<h1>Product List</h1>
<a href="welcome.jsp">Back</a><br/>

<hr/>

<table border="1">
<tr>
<td><b>Order-Number</b></td>
<td><b>Description</b></td>
<td><b>Price</b></td>
<td><b>Inventory</b></td>
</tr>
<c:forEach var="product" items="${sessionScope.productList}">
<jsp:useBean id="product" type="BOProduct" />
<tr>
<!--  <td><%= product.getOrderNumberCustomer() %></td> -->
<td><a href="<%= response.encodeURL("controllerservlet?action=showProductDetails&id=") + product.getMaterialNumber() %>"><%= product.getOrderNumberCustomer() %></a></td>
<td><%= product.getShortDescription() %></td> 
<td><% if (product.getSalesPrice() != null) 
	{ %>
	<%= product.getSalesPrice().getAmount() %> 
	<%= product.getSalesPrice().getCountry().getCurrency().getCode() %>
	<% } %></td>
<% BOWarehouse warehouse = WarehouseBOA.getInstance().findByProduct(product); %>
<td><% if (warehouse != null) 
	{ %>
	<%= warehouse.getInventory() %> 
	<% } %></td>
</tr>
</c:forEach>
</table>

<hr>
</body>
</html>
